package com.friend.ui.activity.presenter;

import com.friend.ui.activity.view.LoginView;
import com.example.okhttputils.mvp.base.BaseModel;
import com.example.okhttputils.mvp.base.BaseObserver;
import com.example.okhttputils.mvp.base.BasePresenter;

import java.util.Map;

/**
 * 作者: admins
 * 时间: 2019/7/1 11:14
 * 描述:
 * 来源
 */
public class LoginPresenter extends BasePresenter<LoginView> {
    public LoginPresenter(LoginView baseView) {
        super(baseView);
    }
    /**
     * 获取短信验证码
     * @param map
     */
    public void getLogin(Map<String, String> map){
        addDisposable(apiServer.getLogin(map), new BaseObserver<BaseModel>(baseView) {
            @Override
            public void onSuccess(BaseModel o) {
                baseView.onLogin(o);
            }

            @Override
            public void onError(String msg) {
                baseView.showError(msg);
            }
        });
    }
}
